<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>青鸟影院管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/layui.css" media="all">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/common.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo"><span>青鸟影院管理系统</span></div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="updateAdmin.html" >
                    <img src="${pageContext.request.contextPath}/img/default.png" class="layui-nav-img layui-anim layui-anim-rotate"/>
                    <span id="user_name"></span>
                </a>
            </li>
            <li class="layui-nav-item"><a href="adminNo">退出</a></li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test" id="leftside">
                <script id="side" type="text/html">
                    {{#  layui.each(d.list, function(index, item){ }}
                    <li class="layui-nav-item">
                        <a href="{{item.url}}"><i class="layui-icon {{item.icon}}"></i> {{item.name}}</a>
                    </li>
                    {{#  }); }}
                    {{#  if(d.list.length === 0){ }}
                    无数据
                    {{#  } }}
                </script>
            </ul>
        </div>
    </div>
    <div class="layui-body">
        <!-- 主体区域开始 -->

        <!--当前位置开始-->
        <div class="layui-card layadmin-header">
                <span class="layui-breadcrumb">
                    <a href="">系统</a>
                    <a href="">座位排表</a>
                    <a><cite>添加</cite></a>
                </span>
        </div>
        <!--当前位置结束-->
        <div class="layui-row">
            <div class="layui-tab" id="system">
                <form action="addSchedule" method="post" id="system_form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">影厅</label>
                        <div class="layui-input-block">
                            <select name="hallId" required autocomplete="off" class="layui-input">
                                <option value="">请选择播放的影厅</option>
                                <c:forEach items="${halls}" var="hall">
                                    <option name="hallId" value="${hall.hallId}">${hall.hallName}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">影片</label>
                        <div class="layui-input-block">
                            <select name="movieId" required autocomplete="off" class="layui-input">
                                <option value="">请选择播放的影片</option>
                                <c:forEach items="${movies}" var="movie">
                                    <option name="movieId" value="${movie.movieId}">${movie.movieName}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">价格</label>
                        <div class="layui-input-block">
                            <input type="text" name="prise" required  lay-verify="required" placeholder="请输入价格" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开始日期</label>
                        <div class="layui-input-block">
                            <input type="date" name="date" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开始小时</label>
                        <div class="layui-input-block">
                            <input type="text" name="hour" required  lay-verify="required" placeholder="请输入开始小时" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开始分钟</label>
                        <div class="layui-input-block">
                            <input type="text" name="mm" required  lay-verify="required" placeholder="请输入开始分钟" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button type="submit" class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <!--主体区域结束-->
    </div>
    <div class="layui-footer" style="text-align:center">
        <!-- 底部固定区域 -->
        © 版权管理
    </div>
</div>
<script src="${pageContext.request.contextPath}/js/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/js/jquery-3.3.1.js"></script>
<script src="${pageContext.request.contextPath}/js/common.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.cookie.js"></script>



<script type="text/javascript">
    $(function () {
        dept_id();
    })
    var str = "";
    function dept_id() {
        $.ajax({
            url : "/SSM_CMS/findDept.do",
            type : "get",
            success : function (m) {
                var arry = JSON.parse(m);
                console.log(arry);

                for(var ids in arry){
                    str +="<option value='"+arry[ids]["id"]+"'>"+arry[ids]["ename"]+"</option>"
                }
                $('#deptid').append(str);
                layui.use('form',function(){//重新渲染
                    var form=layui.form;
                    form.render('select');
                })
            }
        });
    }

</script>
</body>
</html>
